<!-- 商品详情 -->
<script setup>
import { ref } from 'vue';
// const props = defineProps(['username', 'avator']);
const mTitle = ref('');
mTitle.value;
onLoad((option) => {
    console.log('ddd=', option);
    console.log('title=', option.title);
    mTitle.value = option.title;
    console.log(' mTitle.value=', mTitle.value);
    uni.showToast({
        title: `点击${mTitle.value}`,
        icon: 'none'
    });
});
const toshopDetail = (id) => {
    uni.showToast({
        title: '进店....',
        duration: 2000
    });
};
// 购物车;
const options = ref([
    {
        icon: 'chat',
        text: '客服'
    },
    {
        icon: 'shop',
        text: '店铺',
        info: 2,
        infoBackgroundColor: '#007aff',
        infoColor: '#f5f5f5'
    },
    {
        icon: 'cart',
        text: '购物车',
        info: 2
    }
]);
const buttonGroup = ref([
    {
        text: '加入购物车',
        backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)',
        color: '#fff'
    },
    {
        text: '立即购买',
        backgroundColor: 'linear-gradient(90deg, #FE6035, #EF1224)',
        color: '#fff'
    }
]);
const onClick = (e) => {
    uni.showToast({
        title: `点击${e.content.text}`,
        icon: 'none'
    });
};
const buttonClick = (e) => {
    console.log(e);
    // options.vaule[2].info++;
    uni.showToast({
        title: `点击${e.content.text}`,
        icon: 'none'
    });
};
const back = () => {
    uni.navigateBack({
        delta: 1
    });
};
const toCart = () => {
    uni.showToast({
        title: `点击购物车`,
        icon: 'none'
    });
};

const popup = ref(null);
// const popupComputed = computed(() => popup.value.open);
const onItemClick = (e) => {
    console.log('1231231');
    popup.value.open('bottom');
};
</script>
<template>
    <!-- 导航 -->
<!--    <view>
        <view class="box-bg">
            <uni-nav-bar left-icon="left" right-icon="cart" :title="mTitle" @clickLeft="back" @clickRight="toCart" />
        </view>
    </view> -->

    <view>
        <BannerLarge></BannerLarge>
    </view>
    <view class="snack-sell">
        <!-- ¥19.98/份 -->
        <text class="price">¥19.98/份</text>
        <!-- 鲜牛肉+培根+牛丸—+6种蔬菜含米饭 -->
        <text class="name">鲜牛肉+培根+牛丸—+6种蔬菜含米饭</text>
    </view>
    <!--    选择：锅底必选 -->
    <view class="snack-option">
        <uni-list>
            <uni-list-item showArrow title="选择:锅底必选" clickable="true" @click="onItemClick(1)" />
            <!-- <uni-list-item showArrow title="列表文字" rightText="右侧文字" /> -->
        </uni-list>
    </view>
    <uni-popup ref="popup" type="bottom" background-color="#fff">底部弹出 Popup</uni-popup>
    <!-- 店铺-->
    <view class="shop">
        <view class="c-header">
            <image class="icon" src="@/static/temp/ad_duck_shop.jpeg"></image>
            <view class="c-title">
                <text class="title">麻辣香锅冒菜（大成店）</text>
                <br />
                <text class="card-actions-item-text">南京市仙林大学城大成名店负一楼</text>
            </view>
            <view class="localtion">
                <uni-tag :inverted="true" text="进店逛逛" type="warning" style="margin-right: 10rpx" @click="toshopDetail(id)" />
            </view>
        </view>
    </view>
    <!-- 购物车底部 -->
    <view class="goods-carts">
        <uni-goods-nav :options="options" :fill="true" :button-group="buttonGroup" @click="onClick" @buttonClick="buttonClick" />
    </view>
</template>

<style lang="scss">
page {
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
}
.product-banner {
    height: 30vh;
}
.snack-sell {
    background: $uni-bg-color;
    display: flex;
    flex-direction: column;
    padding: 20rpx;
    .price {
        font-size: 50rpx;
        color: orange;
        margin-bottom: 20rpx;
    }
    .name {
        font-size: 35rpx;
        color: black;
        font-weight: bold;
    }
}
.snack-option {
    margin-top: 20rpx;
}
.shop {
    width: 730rpx;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: left;
    margin: 10rpx;
    padding-bottom: 10rpx;
    box-sizing: border-box;
    background-color: $uni-bg-color;
    border-radius: 10rpx;
}
.navigator-hover {
    background-color: rgba(0, 0, 0, 0.1);
    opacity: 0.7;
}
.c-header {
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-items: center;
    margin: 10rpx 10rpx 0 10rpx;
    .icon {
        width: 150rpx;
        height: 150rpx;
    }
    .c-title {
        align-self: flex-start;
        margin: 0 2rpx 10rpx;
        display: flex;
        align-items: baseline;
        flex-direction: column;
        justify-content: flex-start;
        flex: 1;
        // background-color: rgba($color: #000000, $alpha: 0.4);
    }
    .card-actions-item-text {
        font-size: 14px;
        color: #666;
        margin-left: 5px;
    }
    .card-right-location {
        display: flex;
        align-items: flex-end;
        color: #666;
        margin-bottom: 10rpx;
    }
}
.localtion {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.delivery {
    display: flex;
    justify-content: center;
    margin-bottom: 10rpx;
}
// 购物车
.example-body {
    padding: 0;
    /* #ifndef APP-NVUE */
    display: block;
    /* #endif */
}

.goods-carts {
    /* #ifndef APP-NVUE */
    display: flex;
    /* #endif */
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    /* #ifdef H5 */
    left: var(--window-left);
    right: var(--window-right);
    /* #endif */
    bottom: 0;
}
</style>
